#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int n;
    cin >> n;
    for (int i = n; i >= 0; i--)
    {
        int a;
        cin >> a;
        if (a == 0)
            continue;
        if (a < 0)
        {
            cout << '-';
        }
        else
        {
            if (i != n)cout << '+';
        }
        a = abs(a);
        if (a != 1 || (i == 0 && a == 1))
        {
            cout << a;
        }
        if (i == 0)
            continue;
        else if (i == 1) cout << 'x';
        else cout << "x^" << i;
    }
    return 0;
}